
const path = require('path')
const fs = require('fs')
//拼接路径
// const finalPath = path.join('a','b','c')
// const finalPath = path.join('aa','.bb','../c','/hello')
// const finalPath = path.resolve('aa','.bb','../c','/hello')
// console.log(finalPath);
//表示当前文件所在目录
console.log(__dirname);
//读取路径时最好选择绝对路径
fs.readFile(path.join(__dirname,'1.txt','utf8',(err,data) => {
  if (err) throw err
  console.log(data);
}))